Component({
  options: {
    addGlobalClass: true
  },
  properties: {
    renewWay: Number,
    renewDetailData: Object,
  },
  data: {
    visible: false,
  },
  methods: {
    handleClose () {
      this.setData({visible: false})
    },
    handleStop () {
      return true;
    },
    handleChange (e) {
      let index = e.currentTarget.dataset.index;
      if (index === '2' && !this.data.renewDetailData.memberRenew) {
        return;
      }
      if (index === '1' && !this.data.renewDetailData.freeRenew) {
        return;
      }
      this.setData({renewWay: Number(index)})
    },
    open() {
      this.setData({visible: true})
    }
  }
});
